Get Random Quote from Goodreads
(
44
actions, 37 KB)
0 URL
https://www.goodreads.com
γβ baseURL
γΒ»
1
7
32
1 Get Contents of URL
[0 baseURL]
/quotes
γΒ»
2 Make HTML from Rich Text
[1 Contents of URL]
γΒ»
3 Match Text
class="gr-hyperlink" href="(.*?)"
in
[2 HTML from Rich Text]
γΒ»
4 Get Match Group At Index 1 in
[3 Matches]
γΒ»
5 Get
Random Item
from List
[4 Text]
γΒ»
7
6 Random Number between
1
and
3
γβ page
γΒ»
7 Get Contents of URL
[0 baseURL]
[5 Item from List]
?page=
[6 page]
γΒ»
8 Make HTML from Rich Text
[7 Contents of URL]
γΒ»
9
11
13
15
9 Match Text
class="quoteText"[\s\S]*?“(.*?)”
in
[8 HTML from Rich Text]
γΒ»
10 Get Match Group At Index 1 in
[9 Matches]
γβ quotes
γΒ»
26
28
11 Match Text
<span class="authorOrTitle">\s*(.*?)\s*</span>
in
[8 HTML from Rich Text]
γΒ»
12 Get Match
Group At Index
1 in
[11 Matches]
γβ authors
γΒ»
17
33
13 Match Text
<a class="authorOrTitle" href=".*">(.*?)</a>
in
[8 HTML from Rich Text]
γΒ»
14 Get Match
Group At Index
1 in
[13 Matches]
γβ books
γΒ»
21
15 Match Text
title="View this quote" href="(.*?)"
in
[8 HTML from Rich Text]
γΒ»
16 Get Match Group At Index 1 in
[15 Matches]
γβ quoteLinks
γΒ»
31
17 Repeat with Each in
[12 authors]
18 If
[Repeat Item
βs Name
]
ends with
,
19 Count Items in
[dict
βs Keys
]
γΒ»
20 Calculate
[19 Count]
+
1
γΒ»
21 Get
Item At Index
[20 Calculation Result]
from List
[14 books]
γΒ»
22 Set Dictionary Value for
[Repeat Index]
to
[21 Item from List]
in
[dict]
γΒ»
23 Set Variable
dict
to
[22 Dictionary]
24 End Ifγβ΅
18
25 End Repeat with Eachγβ΅
17
26 Count Items in
[10 quotes]
γΒ»
27 Random Number between
1
and
[26 Count]
γΒ»
28
31
33
37
28 Get
Item At Index
[27 Random Number]
from List
[10 quotes]
γβ quote
γΒ»
29 Make Rich Text from HTML
[28 quote]
γβ quote
γΒ»
30 Replace Text
\n+
with
\u{space}
in
[29 quote]
γΒ»
35
ReplaceTextRegularExpression
:
true
31 Get
Item At Index
[27 Random Number]
from List
[16 quoteLinks]
γβ quoteLink
γΒ»
32 URL
[0 baseURL]
[31 quoteLink]
γΒ»
35
33 Get
Item At Index
[27 Random Number]
from List
[12 authors]
γβ author
γΒ»
34
36
34 Make Rich Text from HTML
[33 author]
γβ author
γΒ»
39
41
35 DictionaryγΒ»
39
41
{ "quote": "
[30 Updated Text]
", "url": "
[32 URL]
" }
36 If
[33 author
βs Name
]
ends with
,
37 Get Dictionary Value for
[27 Random Number]
in
[dict]
γβ book
γΒ»
38 Make Rich Text from HTML
[37 book]
γβ book
γΒ»
39 Set Dictionary Value for
author
to
[34 author]
[38 book]
in
[35 Dictionary]
40 Otherwise
41 Set Dictionary Value for
author
to
[34 author]
in
[35 Dictionary]
42 End IfγΒ»
43 Stop and Output
[42 If Result]